package hotel.compare.oversea.mapper.master;

import hotel.base.oversea.repository.MyMapper;
import hotel.base.oversea.vo.meituan.request.room.CompareRoomForFpVO;
import hotel.compare.oversea.entity.master.CompareHotel;
import hotel.compare.oversea.vo.CompareHotelListVO;
import hotel.compare.oversea.vo.CompareHotelVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * @author zhangjinzheng
 * @date 2019-11-22
 */
public interface CompareHotelMapper extends MyMapper<CompareHotel> {
    Long findOneNotCreateMasterHotel(Map ma);

    void updateCompareMasterIsCreateSub(Map map);
    /**
     * 根据携程酒店id获取对应的美团id
     * @param masterHotelId
     * @return
     */
    String getCompareMtHotelId(@Param("hotelId") int masterHotelId);

    /**
     * 获取效验后的酒店列表
     */
    List<CompareHotel> getCompareHotel();

    /**
     * 获取美团id
     * @param masterHotelId
     * @return
     */
    CompareHotel selectMtHotelId(@Param("masterHotelId") Integer masterHotelId);

    /**
     * <H1>获取核验后酒店信息列表</H1>
     *
     * @param compareHotelVO
     * @return java.util.List<hotel.compare.overseaHotelListVO>
     * @author HuangT
     * @date 2020/7/24 16:41
    */
    List<CompareHotelListVO> getCompareHotelList(CompareHotelVO compareHotelVO);

    /**
     * <H1>批量校验</H1>
     *
     * @param
     * @param compareHotel
     * @param ids
     * @return java.lang.Integer
     * @author HuangT
     * @date 2020/7/30 17:05
    */
    Integer changeIsCompare(@Param("t") CompareHotelVO compareHotel, @Param("ids") List<String> ids);

    /**
     * <H1>根据ID获取对比信息</H1>
     *
     * @param id
     * @return hotel.compare.overseaHotelListVO
     * @author HuangT
     * @date 2020/7/31 10:20
    */
    @Select("select * from sys_compare_hotel where id = #{id}")
    CompareHotelListVO getHotelInfoById(String id);

    /**
     * <H1>验证是否已经存在校验后的酒店</H1>
     *
     * @param compareHotel
     * @return java.util.List<hotel.compare.overseaHotelListVO>
     * @author HuangT
     * @date 2020/8/10 18:46
    */
    List<CompareHotelListVO> checkExist(@Param("t") CompareHotelVO compareHotel);

    List<Long> findNotCreateMtHotelId(Map map);

    Long findOneNotCreateMasterHotelNotSet();

    //获取剩余待爬取酒店数量
    Integer countHasHotelSpider();

    int updateCompareHotelIsAgent(@Param("id") String id);

    /**
     * <H1>获取美团ID</H1>
     *
     * @param compareHotelForFpVO    实体对象
     * @return java.util.List<java.lang.String>
     * @author HuangT
     * @Date 2020/9/21 20:51
    */
//    List<CompareRoomForFpVO> getMtHotelIds(CompareHotelForFpVO compareHotelForFpVO);

    /**
     * 根据美团的酒店id 批量修改酒店的状态,让它进行创建
     * @param mtHotelId
     * @return
     */
    int updateIsCreateStatusByMtHotelId(@Param("mtHotelId") List<Integer> mtHotelId);
    /***
    * @Author: lmf
    * @Date: 2020/12/11
     * 根据美团酒店id获取携程酒店id
    */
    Integer getCompareHotelId(@Param("mtHotelId") int mtHotelId);

    List<CompareHotel> getSwPhoneList();

    /**
     * 根据携程的酒店id 批量修改酒店的携程电话
     * @return
     */
    int updateSwPhoneBySwHotelId(CompareHotel compareHotel);


    List<CompareHotel> getMtPhoneList();

    /**
     * 根据美团的酒店id 批量修改酒店的美团电话
     * @return
     */
    int updateMtPhoneByMtHotelId(CompareHotel compareHotel);

}
